package com.gszkc.mapper;

import com.gszkc.entity.SetmealDish;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    /**
     * 根据菜品ID列表查询对应的套餐ID
     * @param dishIds
     * @return
     */
    List<Long> getSetmealIdsByDishIds(List<Long> dishIds);

    /**
     * 新增套餐菜品表
     */
    void insertBatch(List<SetmealDish> setmealDishes);

    /**
     * 根据套餐ID查询对应的菜品列表
     * @return
     */
    @Select("select * from setmeal_dish where setmeal_id = #{setmeal_id}")
    List<SetmealDish> getById(Long setmeal_id);


    /**
     * 根据套餐ID删除对应的菜品信息
     * @param setmeal_id
     */
    @Delete("delete from setmeal_dish where setmeal_id = #{setmeal_id}")
    void deleteById(Long setmeal_id);

    /**
     * 批量删除
     * @param ids
     */
    void deleteBatchByIds(List<Long> ids);
}
